package com.openbravo.pos.config;

import com.openbravo.basic.BasicException;
import com.openbravo.pos.forms.AppConfig;
import com.openbravo.pos.forms.AppLocal;
import com.openbravo.pos.forms.AppProperties;
import com.openbravo.pos.forms.JRootFrame;
import java.awt.Container;
import java.awt.Dimension;
import java.awt.EventQueue;
import java.awt.Toolkit;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.io.IOException;
import javax.imageio.ImageIO;
import javax.swing.JFrame;
import javax.swing.UIManager;

public class JFrmConfig extends JFrame
{
  private JPanelConfiguration config;

  public JFrmConfig(AppProperties paramAppProperties)
  {
    initComponents();
    try
    {
      setIconImage(ImageIO.read(JRootFrame.class.getResourceAsStream("/com/openbravo/images/favicon.png")));
    }
    catch (IOException localIOException)
    {
    }
    setTitle("Openbravo POS - 2.30.2 - " + AppLocal.getIntString("Menu.Configuration"));
    addWindowListener(new MyFrameListener());
    this.config = new JPanelConfiguration(paramAppProperties);
    getContentPane().add(this.config, "Center");
    try
    {
      this.config.activate();
    }
    catch (BasicException localBasicException)
    {
    }
  }

  private void initComponents()
  {
    setDefaultCloseOperation(0);
    Dimension localDimension = Toolkit.getDefaultToolkit().getScreenSize();
    setBounds((localDimension.width - 731) / 2, (localDimension.height - 679) / 2, 731, 679);
  }

  public static void main(final String[] val$args)
  {
    EventQueue.invokeLater(new Runnable( )
    {
      public void run()
      {
        AppConfig localAppConfig = new AppConfig(val$args);
        localAppConfig.load();
        try
        {
          UIManager.setLookAndFeel(localAppConfig.getProperty("swing.defaultlaf"));
        }
        catch (Exception localException)
        {
        }
        new JFrmConfig(localAppConfig).setVisible(true);
      }
    });
  }

  private class MyFrameListener extends WindowAdapter
  {
    private MyFrameListener()
    {
    }

    public void windowClosing(WindowEvent paramWindowEvent)
    {
      if (JFrmConfig.this.config.deactivate())
        JFrmConfig.this.dispose();
    }

    public void windowClosed(WindowEvent paramWindowEvent)
    {
      System.exit(0);
    }
  }
}

/* Location:           D:\PowerFulPOS-2.30.2\openbravopos.jar
 * Qualified Name:     com.openbravo.pos.config.JFrmConfig
 * JD-Core Version:    0.6.0
 */